import Vue from 'vue' //导入vue
import Router from 'vue-router' //导入vue-router
import Layouts from '@/components/layouts' //导入组件
import todo from '@/components/todo'


Vue.use(Router) //全局注册router组件,它会绑定到vue实例

export default new Router({ //创建router实例，然后传'routes'配置
    routes: [{
        path: '/',
        name: 'Layouts', //路径名
        component: Layouts, //访问组件
        children: [{
            path: 'todo/:id',
            name: 'todo',
            component: todo
        }]
    }]

})